import request from '@/utils/request'

export async function getSamplesListApi(params) {
  var resp = await request({
    url: '/samples/list/',
    method: 'get',
    params
  })
  return resp;
}

export async function getSamplesApi(id) {
  var resp = await request({
    url: '/samples/list/' + id + '/',
    method: 'get'
  })
  return resp
}

export async function createSamplesApi(data) {
  var resp = await request({
    url: '/samples/list/',
    method: 'post',
    data
  })
  return resp
}

export async function updateSamplesApi(id, data) {
  var resp = await request({
    url: '/samples/list/' + id + '/',
    method: 'put',
    data
  })
  return resp
}

export async function deleteSamplesApi(id) {
  var resp = await request({
    url: '/samples/list/' + id + '/',
    method: 'delete'
  })
  return resp
}

export async function releaseSamplesApi(id) {
  var resp = await request({
    url: '/samples/list/' + id + '/release/',
    method: 'put'
  })
  return resp
}

export async function closeSamplesApi(id) {
  var resp = await request({
    url: '/samples/list/' + id + '/close/',
    method: 'put'
  })
  return resp
}
